package top.zackyoung.springboot.config

import com.alibaba.fastjson.serializer.ValueFilter

import java.math.BigDecimal

class ScalaBigDecimalValueFilter extends ValueFilter {
  override def process(o: Any, name: String, value: Any): Any = {
    if (value != null && value.isInstanceOf[BigDecimal]) return value.asInstanceOf[BigDecimal].stripTrailingZeros.toPlainString
    return value
  }
}
